<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import = "auser.*" %>
<%@page import = "java.util.*" %>
<% session.invalidate(); %>
<c:set var="pageMethod"  value="<%=request.getMethod()%>" />
<c:if test="${pageMethod=='GET'}"><c:redirect url="/index.jsp"/></c:if>
<c:if test="${empty param.j_username || empty param.j_password}">
<jsp:forward  page="/index.jsp" >
	<jsp:param name="j_username" value="${param.j_username}"/>
	<jsp:param name="j_password" value="${param.j_password}"/>
	<jsp:param name="gruppo" value="${param.gruppo}"/>
	<jsp:param name="j_message" value="Inserire sia Utente che Password."/>
</jsp:forward>
</c:if>

<c:set var="userFound"  value="<%=facades.SessionFacade.getLogin(request)%>" />

<c:if test="${!userFound}">
	<jsp:forward  page="/index.jsp" >
		<jsp:param name="j_username" value="${param.j_username}"/>
		<jsp:param name="gruppo" value="${param.gruppo}"/>
		<jsp:param name="j_message" value="Utente non trovato."/>
	</jsp:forward>
</c:if>	

<c:if test="${userFound}"> 
	<jsp:forward  page="/app/start/index.jsp" >
		<jsp:param name="ause_user" value="${param.j_username}" />
		<jsp:param name="ause_group" value="${param.gruppo}" />
	</jsp:forward>
</c:if>	